<template>
    {{content}}
</template>

<script lang='ts' setup>
    import { parseTime } from "@/utils";
    import { computed, useSlots } from "vue";

    const props = defineProps<{
        format?:string
    }>()

    const slots = useSlots()

    const content = computed(() => {
        if(slots.default) {
            let text = Number((slots.default())[0].children)
            if(!isNaN(text)) {
                return parseTime(text, props.format)
            }
            
        }

        return ''
    })
</script>